package com.vhukze.basics.enumeration;

import lombok.Getter;

@Getter
public enum RespCodeEnum {

    // 未知异常
    INTERNAL(-2, "内部异常"),

    UNKNOWN(-1, "未知异常"),

    NOT_TOKEN(1, "未提供token"),

    SUCCESS(0, "成功"),

    PARAM_ERR(400, "参数错误"),
    PARAM_ILLEGAL(410, "参数非法"),
    PARAM_NOT_FOUND(444, "参数缺失"),
    PARAM_FORMAT_ERR(445, "参数格式不正确"),

    USER_PASS_ERR(510, "用户名或密码错误"),
    VERIFY_CODE_ERR(511, "验证码错误"),

    NOT_FIND(601, "未查询到相关数据"),
    NAME_EXIST(603, "名称已存在"),
    PARSE_ERR(604, "解析失败，检查文件内容格式"),
    SQL_ERR(605, "SQL执行错误"),

    CONN_DB_FAIL(700, "连接数据库失败"),

    TEST(1111, "");

    private final String message;
    private final int code;

    RespCodeEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }
}